package com.vhall.component.entity.export.dto;

import com.vhall.component.plugin.common.utils.JsonUtil;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.apache.commons.lang3.StringUtils;

/**
 * admin导出通用查询条件
 *
 * @author yuanzh
 * @date 2021/11/23
 */
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Data
public class AdminExportDocumentQueryCondition extends AdminExportCommonQueryCondition {

    private static final long serialVersionUID = 3338414244564689224L;

    /**
     * 转换进度
     * 1=待转码 2=转码中 3=转码成功 4=转码失败
     */
    private Integer transStatus;


    /**
     * 转换查询json为查询对象
     *
     * @param queryCondition 查询条件
     * @return 查询对象
     */
    public static AdminExportDocumentQueryCondition convertTo(String queryCondition) {
        if (StringUtils.isBlank(queryCondition)) {
            return null;
        }
        return JsonUtil.objectFromJSONString(queryCondition, AdminExportDocumentQueryCondition.class);
    }

}
